home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagg_m.zip / MEMORY.SWG / 0006_FREEMEM1.PAS.pas < prev    next >
Pascal/Delphi Source File  |  1993-05-28  |  390b  |  19 lines

  1. {
  2. Does anyone have any routines to find the available memory outside of the
  3. heap ?
  4. }
  5.  
  6. Function GetFreeMemory : LongInt;
  7. Var
  8.   Regs : Registers;
  9. begin
  10.   Regs.AH := $48;
  11.   Regs.BX := $FFFF;
  12.   Intr($21,Regs);
  13.   GetFreeMemory := LongInt(Regs.BX)*16;
  14. end;
  15. {
  16.  
  17. This Procedure tries to allocate 1MB memory (what's impossible).
  18. Dos will give you the maximum of free memory back.
  19. }